﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data;

namespace hsgsSHXX.BLL
{
    /// <summary>
    /// 社会信息资源库 逻辑类
    /// </summary>
    public class SHXX
    {
        /// <summary>
        /// 社会信息资源库DAL
        /// </summary>
        private DAL.SHXX shxxDAL = new DAL.SHXX();

        public SHXX()
        {
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<hsgsSHXX.Model.SHXX> GetFondListByPage(int pageSize, int pageIndex, string strWhere, string fOrderFiled, out int total)
        {
            DataSet ds = shxxDAL.GetFondListByPage(pageSize, pageIndex, strWhere, fOrderFiled, out total);
            return DataTableToList(ds.Tables[0]);
        }
        /// <summary>
        /// 获得数据列表
        /// </summary>
        public List<hsgsSHXX.Model.SHXX> DataTableToList(DataTable dt)
        {
            List<hsgsSHXX.Model.SHXX> modelList = new List<hsgsSHXX.Model.SHXX>();
            int rowsCount = dt.Rows.Count;
            if (rowsCount > 0)
            {
                hsgsSHXX.Model.SHXX model;
                for (int n = 0; n < rowsCount; n++)
                {
                    model = shxxDAL.DataRowToModel(dt.Rows[n]);
                    if (model != null)
                    {
                        modelList.Add(model);
                    }
                }
            }
            return modelList;
        }
    }
}
